<?php
$additionKey='thisiskey';
$manageKey='key';

function split_code($code)
{
    return explode('-',$code);
}

function joint_code($user,$video)
{
    return $user.'-'.$video;
}

function write_ini_file($filename,$data)
{
    $content='';
    foreach ($data as $varName => $val)
        $content=$content.$varName.'='.$val."\r\n";
    $f = fopen($filename, "w");
    fwrite($f, $content);
    fclose($f);
}

function queryKey($value,$data)
{
    foreach ($data as $k => $v)
    {
        if($v===$value)
            return $k;
    }
    return NULL;
}

function safeVerify($query)
{
    foreach ($query as $elm)
    {
        if($elm=='')
            return false;
    }
    return true;
}